#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>;


struct Stu 
{
	char name[20];
	int age;

};

int Cmp_By_Name(const void* elm1,const  void* elm2)
{
	return strcmp( ( (struct Stu*)elm1)->name, ((struct Stu*)elm2)->name);
}

int Cmp_By_Age(const void* elm1, const  void* elm2)
{
	return (((struct Stu*)elm1)->age-((struct Stu*)elm2)->age);
}



int main()
{
	struct Stu s[3] = { {"zhangsan",18},{"lisi",20},{"wangwu",22}};
	int sz = sizeof(s) / sizeof(s[0]);
	qsort(s, sz, sizeof(s[0]), Cmp_By_Name);
	qsort(s, sz, sizeof(s[0]), Cmp_By_Age);
	










	return 0;
}